
#ifndef __FORWARD_SERVER_H
#define __FORWARD_SERVER_H

#include "../iface/LibSSH2Interface.h"
#include "TCPServer.h"

// One-thread for security, only one session at a time
// - if it's not my session, the whole thing will stop

class ForwardServer : public TCPServer
{
   public:
      ForwardServer(int iportno, const char *ihostname, apr_pool_t *upperpool) :
         TCPServer(1, iportno, ihostname, upperpool) {}
      ~ForwardServer() {}
      static void *ClientHandler(apr_thread_t *tthread, void *args);
      virtual functor GetClientHandlerFunction() const { return (functor)(&ClientHandler); }
      void SetForwardingChannel(LIBSSH2_CHANNEL *ifchannel);
   private:
      LIBSSH2_CHANNEL *fchannel;
};

#endif
